Quick Sort Visualization

OVERVIEW


QuickSort is a sorting algorithm based on the Divide and Conquer that picks an element as a pivot and partitions the given array around the picked pivot by placing the pivot in its correct position in the sorted array.

Time Complexity


  • Best Case: O(nlogn) (Pivot divides array evenly).
  • Average Case: O(nlogn) (Random Pivot)
  • Worst Case: O(n2)(Sorted/Reverse sorted with bad pivot).

Color Representation


  • Red → Default color for unsorted elements.
  • Lightcoral → Highlights the chosen pivot element
  • Orange → Indicates movement of the left pointer
  • Cyan → Indicates movement of the right pointer
  • Green → Marks elements in their final sorted position